import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/views/pagetwo/layout/Layout'

export const constantRoutestwo = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: () => import('@/views/pagetwo/redirect')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/pagetwo/login'),
    hidden: true
  },
  {
    path: '/404',
    component: () => import('@/views/pagetwo/errorPage/404'),
    hidden: true
  },
  {
    path: '/401',
    component: () => import('@/views/pagetwo/errorPage/401'),
    hidden: true
  },
  {
    path: '',
    component: Layout,
    redirect: 'dashboard',
    children: [
      {
        path: 'dashboard',
        component: () => import('@/views/pagetwo/dashboard'),
        name: 'Dashboard',
        meta: { title: 'dashboard', icon: 'dashboard', noCache: true }
      }
    ]
  },
  {
    path: '',
    component: Layout,
    redirect: '',
    children: [
      {
        path: 'testNow',
        component: () => import('@/views/pagetwo/testNow'),
        name: 'testNow',
        meta: { title: 'testNow', icon: 'dashboard', noCache: true }
      }
    ]
  }
]

export default new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutestwo
})

